<?php
include_once("codelibrary/inc/variables.php");
include_once("session.php");
include_once("codelibrary/inc/functions.php");

$getData=getAnyTableWhereData($business_info_table," and business_id='$id'");

if(isset($_REQUEST['Submit']))
{
    $companyname=$TR_Company;
	$locationname=$TR_Location;   
	$firstname=$TRFN_FirstName;
	$lastname=$TRFN_LastName;
	$email=$TREF_Email;
	$address=$TR_Address;
	$city=$TR_City;
	$state=$TR_State; 
	$zipcode=$TR_Zip;
	$country=$TR_Country;
	$timezone=$TR_TimeZone;
	$phonenumber=$PHR_Phone;
	$altphonenumber=$PHN_AltPhone;
	$faxnumber=$TN_Fax;
	$directions=$TN_Directions;
	$webaddress=$TN_WebAddress;
	////Not Valid for headquarters,valid only for locations set up under a particular main HeadQuarters of the Company
	$optionsettings=$TN_OptionSettings; 
	
	mysql_query("update $business_info_table set companyname='".$companyname."', locationname='".$locationname."', firstname='".$firstname."', lastname='".$lastname."', email='".$email."', address='".$address."', city='".$city."', state='".$state."', zipcode='".$zipcode."', country='".$country."', timezone='".$timezone."', phonenumber='".$phonenumber."', altphonenumber='".$altphonenumber."', faxnumber='".$faxnumber."', directions='".$directions."', webaddress='".$webaddress."', optionsettings='".$optionsettings."' where business_id='$id'");
		
	header("Location: location-view-details.php?msg=Edited");
}

?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="LTR" lang="en">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<title>Online Appointment - Site Administration</title>
<script type="text/javascript" src="codelibrary/js/common.Js"></script>
<script type="text/javascript">
function submitform()
{
 
	if(ValidateForm(document.frm))
	{
	    return true;
	}
	else
	{
	    return false;
	}
}
</script>

<base >
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<title>Staff Management</title>

</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">


<table cellpadding="0" cellspacing="0" border="0">
  <tr>
    <td style="background:url(images/top.gif) repeat-x top; "><table cellpadding="0" cellspacing="0" border="0" style="width:764px" align="center">
        <tr>
          <td><table cellpadding="0" cellspacing="0" border="0" style="height:57">
              <tr>
                <td height="57"><table cellpadding="0" cellspacing="0" border="0" style="height:1 ">
                    <tr>
                      <td style="width:468px" height="1"></td>
                      <td height="1"></td>
                    </tr>
                  </table>
                  <table cellpadding="0" cellspacing="0" border="0" style="height:3 ">
                    <tr>
                      <td height="3" valign="top" bgcolor="#2A2A2A"><a href="make-appointment.php"><img src="images/appointment1.gif" width="123" height="25" border="0" align="absmiddle"></a><span class="leftmenutxt"><a href="http://westarexchange.info/aq1/customer-view-details.php" class="topmenulink">Customers</a></span> <img src="images/seprator1.gif" width="11" height="25" align="absmiddle">&nbsp;<a href="http://westarexchange.info/aq1/staff-view-details.php"><span class="topmenulink">Staff Members</span></a><span class="leftmenutxt">&nbsp;<img src="images/seprator1.gif" width="11" height="25" align="absmiddle"></span> <span class="leftmenutxt">&nbsp;<a href="http://westarexchange.info/aq1/service-view-details.php" class="topmenulink">Services</a>&nbsp;<img src="images/seprator1.gif" width="11" height="25" align="absmiddle">&nbsp;&nbsp;<a href="http://westarexchange.info/aq1/reports-view-details.php" class="topmenulink">Reports</a>&nbsp;<img src="images/seprator1.gif" width="11" height="25" align="absmiddle">&nbsp;&nbsp;<a href="http://westarexchange.info/aq1/update-company-location.php" class="topmenulink">Company</a>&nbsp;<img src="images/seprator1.gif" width="11" height="25" align="absmiddle">&nbsp;&nbsp;<a href="http://westarexchange.info/aq1/location-view-details.php" class="topmenulink">Lists</a>&nbsp;<img src="images/seprator1.gif" width="11" height="25" align="absmiddle">&nbsp;&nbsp;<a href="http://westarexchange.info/aq1/help.php" class="topmenulink">Help</a> <img src="images/seprator1.gif" width="11" height="25" align="absmiddle">&nbsp; &nbsp;<a href="http://westarexchange.info/aq1/logout.php" class="topmenulink">Logout</a></span><br></td>
                    </tr>
                  </table></td>
              </tr>
            </table>
            
            
          </td>
        </tr>
        <tr>
          <td>
            
            
            <table border="0" width="105%" cellspacing="0" cellpadding="0">
              <tr>
                <td valign="top" class="col_left">
                  <table border="0"cellspacing="0" cellpadding="0" class="box_width_left">
                    <tr>
                      <td width="100%"><table border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td><table border="0" width="100%" cellspacing="0" cellpadding="0" class="">
                                <tr>
                                  <td><table border="0" width="100%" cellspacing="0" cellpadding="0"  class="" height="91">
                                      <tr>
                                        <td align="center" height="91"><img border="0" src="images/logo.jpg" width="208" height="86"></td>
                                      </tr>
                                    </table></td>
                                </tr>
                              </table></td>
                          </tr>
                          <tr>
                            <td><table border="0" width="100%" cellspacing="0" cellpadding="0"  class="box_header_txt" height="48">
                                <tr>
                                  <td style="background-image: url(images/1_bg2-2.gif)" height="1"><p style="margin-top: 16"> </td>
                                </tr>
                              </table>
                              <table border="0" width="100%" cellspacing="0" cellpadding="0"   style="border-bottom:12px solid #ffffff;">
                                <tr>
                                  <td><table border="0" width="100%" cellspacing="0" cellpadding="0"  style="margin-bottom:0px;background:#7C7C7C url(images/1_line.gif) no-repeat left bottom;" >
                                      <tr>
                                        <td  style="padding:3px 16px 8px 25px;"><? include("link1.php");?></td>
                                      </tr>
                                    </table></td>
                                </tr>
                              </table></td>
                          </tr>
                          
                          <tr>
                            <td class="">&nbsp;</td>
                          </tr>
                          
                        </table></td>
                      <td><img src="images/spacer.gif" border="0" alt="" width="15" height="1"></td>
                    </tr>
                  </table>
                  
                </td>
                
                <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0"  class="cont_header_txt">
                    <tr>
                      <td><table border="0" cellpadding="0" cellspacing="0" bgcolor="#EAEAEA" class="cont_header_txt">
                          <tr>
                            <td><img src="images/1_q1.gif" border="0" alt="" width="45" height="39"></td>
                            <td style="width:100%">UPDATE LOCATION DETAILS</td>
                            <td><img src="images/1_q2.gif" border="0" alt="" width="10" height="39"></td>
                          </tr>
                        </table></td>
                    </tr>
                  </table>
                  
                  <table cellpadding="0" cellspacing="0" border="0" style="border:0px solid #DEDEDE; border-width:0px 1px 0px 1px;">
                    <tr>
                      <td style="background:#ffffff;border:0px solid #ffffff; border-width:18px 5px 10px 5px;"><!-- new_products //-->
                        <table border="0" width="" cellspacing="0" cellpadding="0" class="box_width_cont product">
                          <tr>
                            <td><form name="frm" action="" method="post" onSubmit="return submitform();">
                                <table width="108%" border="1" cellpadding="3" cellspacing="2" class="table">
                                  <tr>
                                    <td width="29%" height="27" valign="bottom" class="smallText">&nbsp;<strong>Company Name</strong> </td>
                                    <td height="27" colspan="2" valign="top" nowrap class="smallText"><label>
                                      <input name="TR_Company" type="text" value="<?=$getData['companyname'];?>" size="30">
                                      </label></td>
                                  </tr>
                                  <tr>
                                    <td height="27" valign="bottom" class="smallText">&nbsp;<strong>Location Name</strong> </td>
                                    <td height="27" colspan="2" valign="bottom" class="smallText"><input name="TR_Location" type="text" value="<?=$getData['locationname'];?>" size="30"></td>
                                  </tr>
                                  <tr>
                                    <td height="27" valign="bottom" class="smallText">&nbsp;<strong>Address</strong> </td>
                                    <td height="27" colspan="2" valign="bottom" class="smallText"><textarea name="TR_Address" rows="3" cols="3"><?=$getData['address'];?>
</textarea></td>
                                  </tr>
                                  <tr>
                                    <td height="27" valign="bottom" class="smallText">&nbsp;<strong>City</strong> </td>
                                    <td height="27" colspan="2" valign="bottom" class="smallText"><INPUT name="TR_City"  type="TEXT" value="<?=$getData['city'];?>" size="30"></td>
                                  </tr>
                                  <tr>
                                    <td height="27" valign="bottom" class="smallText">&nbsp;<strong>State</strong> </td>
                                    <td height="27" colspan="2" valign="bottom" class="smallText"><INPUT name="TR_State"  type="TEXT"  value="<?=$getData['state'];?>" size="30"></td>
                                  </tr>
                                  <tr>
                                    <td height="27" valign="bottom" class="smallText">&nbsp;<strong>Zip Code</strong> </td>
                                    <td height="27" colspan="2" valign="bottom" class="smallText"><INPUT name="TR_Zip"  type="TEXT" value="<?=$getData['zipcode'];?>" size="30"></td>
                                  </tr>
                                  <tr>
                                    <td height="27" valign="bottom" class="smallText">&nbsp;<strong>Country</strong> </td>
                                    <td height="27" colspan="2" valign="bottom" class="smallText"><SELECT name="TR_Country">
                                        <?php

									foreach($ar_country_WI as $key=>$value)
									{
									  
								?>
                                        <OPTION <? if($key!=0){ ?> value="<?=$value;?>" <? } ?> <? if($getData['country']==$value){echo "selected";}?>>
                                        <?=$value;?>
                                        </OPTION>
                                        <?php
									}
							   ?>
                                      </SELECT>
                                    </td>
                                  </tr>
                                  <tr>
                                    <td height="27" valign="bottom" class="smallText">&nbsp;<strong>Phone Number</strong> </td>
                                    <td height="27" colspan="2" valign="bottom" class="smallText"><INPUT name="PHR_Phone" type="TEXT" value="<?=$getData['phonenumber'];?>" size="30">
                                    </td>
                                  </tr>
                                  <tr>
                                    <td height="27" valign="bottom" class="smallText">&nbsp;<strong>Alternate Phone Number</strong> </td>
                                    <td height="27" colspan="2" valign="bottom" class="smallText"><INPUT name="PHN_AltPhone" type="TEXT" value="<?=$getData['altphonenumber'];?>" size="30">
                                    </td>
                                  </tr>
                                  <tr>
                                    <td height="27" valign="bottom" class="smallText">&nbsp;<strong>Fax Number</strong> </td>
                                    <td height="27" colspan="2" valign="bottom" class="smallText"><input name="TN_Fax" type="text" id="TN_Fax" value="<?=$getData['faxnumber'];?>" size="30">
                                    </td>
                                  </tr>
                                  <tr>
                                    <td height="27" valign="bottom" class="smallText">&nbsp;<strong>Contact First Name</strong> </td>
                                    <td height="27" colspan="2" valign="bottom" class="smallText"><INPUT name="TRFN_FirstName"  type="TEXT" value="<?=$getData['firstname'];?>" size="30">
                                    </td>
                                  </tr>
                                  <tr>
                                    <td height="27" valign="bottom" class="smallText">&nbsp;<strong>Contact Last Name</strong> </td>
                                    <td height="27" colspan="2" valign="bottom" class="smallText"><INPUT name="TRFN_LastName" type="TEXT" value="<?=$getData['lastname'];?>" size="30">
                                    </td>
                                  </tr>
                                  <tr>
                                    <td height="27" valign="bottom" class="smallText">&nbsp;<strong>Contact E-mail Address</strong> </td>
                                    <td height="27" colspan="2" valign="bottom" class="smallText"><INPUT name="TREF_Email" type="TEXT" value="<?=$getData['email'];?>" size="30">
                                    </td>
                                  </tr>
                                  <tr>
                                    <td height="27" valign="bottom" class="smallText">&nbsp;<strong>Web Address</strong> </td>
                                    <td height="27" colspan="2" valign="bottom" class="smallText"><input name="TN_WebAddress" type="text" id="TN_WebAddress" value="<?=$getData['webaddress'];?>" size="30">
                                    </td>
                                  </tr>
                                  <tr>
                                    <td height="27" valign="bottom" class="smallText" nowrap="nowrap">&nbsp;<strong>Use Headquarter Values</strong> </td>
                                    <td height="27" colspan="2" valign="bottom" nowrap class="smallText"><label>
                                      <input name="TN_OptionSettings" type="radio" value="1"
								<? 
								
								if($getData['optionsettings']=="yes"){ echo "checked";}?> >
                                      yes
                                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                      <input name="TN_OptionSettings" type="radio" value="0" 
								<? if($getData['optionsettings']=="no"){ echo "checked";}?> >
                                      no </label>
                                      <br>
                                      A "yes" selection means that the location<br>
                                      will share the preferences, services, and other items <br>
                                      that have been set up for the headquarters location.</td>
                                  </tr>
                                  
                                  <tr>
                                    <td height="27" valign="bottom" class="smallText">&nbsp;<strong>Directions</strong> </td>
                                    <td height="27" colspan="2" valign="bottom" class="smallText"><textarea name="TN_Directions" rows="3" cols="40"><?=$getData['directions'];?>
</textarea></td>
                                  </tr>
                                  <tr>
                                    <td height="27" valign="bottom" class="smallText">&nbsp;<strong>Time Zone </strong></td>
                                    <td height="27" colspan="2" valign="bottom" nowrap class="smallText"><label>
                                      <SELECT name="TR_TimeZone">
                                        <?php

									foreach($array_time_zone_WI as $key=>$value)
																{
																  
																?>
                                        <OPTION <? if($key!=0){ ?> value="<?=$value;?>" <? } ?> <? if($getData['timezone']==$value){echo "selected";}?>>
                                        <?=$value;?>
                                        </OPTION>
                                        <?php
																}
																?>
                                      </SELECT>
                                      </label></td>
                                  </tr>
                                  <tr>
                                    <td colspan="3" align="center" valign="middle" class="smallText"><input name="Submit" type="submit" class="button" value="  Update  " />
              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;<input name="reset" type="reset" class="button" value="  Reset  " />
                                    </td>
                                  </tr>
                                </table>
                              </form></td>
                          </tr>
                        </table></td>
                    </tr>
                  </table>
                  
                  <table cellpadding="0" cellspacing="0" border="0">
                    <tr>
                      <td><img src="images/1_q4.gif" border="0" alt="" width="10" height="10"></td>
                      <td style="width:100%; background-image:url(images/1_li1.gif)"></td>
                      <td><img src="images/1_q3.gif" border="0" alt="" width="10" height="10"></td>
                    </tr>
                  </table></td>
                
                <td class="col_right">
                  <table border="0"cellspacing="0" cellpadding="0" class="box_width_right">
                    <tr>
                      <td></td>
                      <td width="100%"><table border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td></td>
                          </tr>
                        </table></td>
                    </tr>
                  </table>
                  
                </td>
              </tr>
            </table>
            
            
          </td>
        </tr>
        <tr>
          <td><table cellpadding="0" cellspacing="0" border="0" style="height:98px; background-image:url(images/bot.gif)">
              <tr>
                <td><table cellpadding="0" cellspacing="0" border="0" class="footer">
                    <tr>
                      <td height="77"><img src="images/spacer.gif" border="0" alt="" width="25" height="1"></td>
                      <td style="width:207px"><br style="line-height:49px">
                        <img src="images/p1.gif" border="0" alt="" width="145" height="24"><br></td>
                      <td style="width:532px">&nbsp;</td>
                    </tr>
                  </table></td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td align="center"></td>
  </tr>
</table>

</body>

</html>
